#ifndef ANIMATION_H_
#define ANIMATION_H_

#include <list>
#include "Position.h"

class GraphicalElement;

class Animation
{
public:
    Animation(unsigned long duration);
    virtual ~Animation();

    virtual void update(double factor) = 0;
    virtual void render(const Position& parent);
    virtual void init();
    void animate(unsigned long tick);
    bool done();
    void setElement(GraphicalElement* element);
    void setDoneDestinationId(long id);

protected:
    GraphicalElement* element;

private:
    unsigned long duration;
    unsigned long time;
    long doneDestinationId;
};

typedef std::list<Animation*> Animations;

#endif
